﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <script src="~/Content/js/jquery-ui/jquery-ui.min.js"></script>
    <script src="~/Content/js/bootstrap/bootstrap.js"></script>
    <link href="~/Content/js/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="~/Content/js/layout/jquery.layout.js"></script>
    <script src="~/Content/js/cookie/jquery.cookie.js"></script>
    @*<script src="~/Content/js/wdtree/tree.js"></script>*@
    <link href="~/Content/js/wdtree/tree.css" rel="stylesheet" />
    <script src="~/Content/js/jqgrid/jqgrid.min.js"></script>
    <link href="~/Content/js/jqgrid/jqgrid.css" rel="stylesheet" />
    <script src="~/Content/js/jqgrid/grid.locale-cn.js"></script>
    <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
    <script src="~/Content/js/select2/select2.min.js"></script>
    <link href="~/Content/js/wizard/wizard.css" rel="stylesheet" />
    <script src="~/Content/js/wizard/wizard.js"></script>
    <script src="~/Content/js/validate/jquery.validate.min.js"></script>
    <script src="~/Content/js/datepicker/WdatePicker.js"></script>
    <script src="~/Content/js/uploadify/jquery.uploadify.min.js"></script>
    <link href="~/Content/js/uploadify/uploadify.css" rel="stylesheet" />
    <link href="~/Content/css/framework-ui.css" rel="stylesheet" />
    <script src="~/Content/js/framework-ui.js"></script>
    <script src="~/Content/js/dialog/dialog.js"></script>
    <link href="~/Content/js/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
    <script src="~/Content/js/ztree/jquery.ztree.core.min.js"></script>
    <script src="~/Content/js/datepicker/DatePicker.js"></script>
    <link href="~/Content/css/bom-ui.css" rel="stylesheet" />
    <script src="~/Content/js/bom-ui.js"></script>
    <link href="~/Content/css/framework-business.css" rel="stylesheet" />
    <script src="../../Content/js/jqprint/jquery.jqprint-0.3.js"></script>
    <script src="~/Content/js/common.js"></script>

    <script type="text/javascript">
        (function ($) {
            $.fn.swapClass = function (c1, c2) {
                return this.removeClass(c1).addClass(c2);
            };
            $.fn.switchClass = function (c1, c2) {
                if (this.hasClass(c1)) {
                    return this.swapClass(c1, c2);
                }
                else {
                    return this.swapClass(c2, c1);
                }
            };
            $.fn.treeview = function (settings) {
                var dfop =
                    {
                        method: "GET",
                        datatype: "json",
                        url: false,
                        param: null,
                        cbiconpath: "/Content/js/wdtree/images/icons/",
                        icons: ["checkbox_0.png", "checkbox_1.png", "checkbox_2.png"],
                        showcheck: false,
                        oncheckboxclick: false,
                        onnodeclick: false,
                        cascadecheck: true,
                        data: null,
                        clicktoggle: true,
                        theme: "bbit-tree-arrows",
                        isTool: false,
                        nodeTools: []
                    };

                $.extend(dfop, settings);
                var treenodes = dfop.data;
                var me = $(this);
                var id = me.attr("id");
                if (id == null || id == "") {
                    id = "bbtree" + new Date().getTime();
                    me.attr("id", id);
                }
                me.height(dfop.height);
                if (dfop.slimscroll == true) {
                    me.css({ "overflow": "auto", "overflow-y": "hidden" });
                } else {
                    me.css({ "overflow": "auto" });
                }
                var html = [];
                buildtree(dfop.data, html);
                me.html('');
                me.addClass("bbit-tree").append(html.join(""));
                InitEvent(me);
                html = null;
                if (dfop.showcheck) {
                    for (var i = 0; i < 3; i++) {
                        var im = new Image();
                        im.src = dfop.cbiconpath + dfop.icons[i];
                    }
                }
                function buildtree(data, ht) {
                    ht.push("<div class='bbit-tree-bwrap'>");
                    ht.push("<div class='bbit-tree-body " + id + "'>");
                    ht.push("<ul class='bbit-tree-root ", dfop.theme, "'>");
                    if (data && data.length > 0) {
                        var l = data.length;
                        for (var i = 0; i < l; i++) {
                            buildnode(data[i], ht, 0, i, i == l - 1);
                        }
                    }
                    else {
                        asnyloadc(null, false, function (data) {
                            if (data && data.length > 0) {
                                treenodes = data;
                                dfop.data = data;
                                if (dfop.description) {
                                    data.unshift({
                                        "id": "",
                                        "text": dfop.description,
                                        "value": "",
                                        "img": "-1",
                                        "parentnodes": "0",
                                        "showcheck": false,
                                        "isexpand": true,
                                        "complete": true,
                                        "hasChildren": false,
                                        "ChildNodes": []
                                    });
                                }
                                var l = data.length;
                                for (var i = 0; i < l; i++) {
                                    buildnode(data[i], ht, 0, i, i == l - 1);
                                }
                            }
                        });
                    }
                    ht.push("</ul>");
                    ht.push("</div>");
                    ht.push("</div>");
                }
                function buildnode(nd, ht, deep, path, isend) {
                    var nid = nd.id.replace(/[^\w]/gi, "_");
                    ht.push("<li class='bbit-tree-node'>");
                    var title = nd.title;
                    if (title) {
                        title = nd.title;
                    } else {
                        title = nd.text;
                    }
                    ht.push("<div id='", id, "_", nid, "' tpath='", path, "' unselectable='on' title='", title, "'");
                    var cs = [];
                    cs.push("bbit-tree-node-el");
                    if (nd.hasChildren) {
                        cs.push(nd.isexpand ? "bbit-tree-node-expanded" : "bbit-tree-node-collapsed");
                    }
                    else {
                        cs.push("bbit-tree-node-leaf");
                    }
                    if (nd.classes) { cs.push(nd.classes); }

                    ht.push(" class='", cs.join(" "), "'>");
                    ht.push("<span class='bbit-tree-node-indent'>");
                    if (deep == 1) {
                        ht.push("<img class='bbit-tree-icon' src='" + dfop.cbiconpath + "s.gif'/>");
                    }
                    else if (deep > 1) {
                        ht.push("<img class='bbit-tree-icon' src='" + dfop.cbiconpath + "s.gif'/>");
                        for (var j = 1; j < deep; j++) {
                            ht.push("<img class='bbit-tree-elbow-line' src='" + dfop.cbiconpath + "s.gif'/>");
                        }
                    }
                    ht.push("</span>");
                    cs.length = 0;
                    if (nd.hasChildren) {
                        if (nd.isexpand) {
                            cs.push(isend ? "bbit-tree-elbow-end-minus" : "bbit-tree-elbow-minus");
                        }
                        else {
                            cs.push(isend ? "bbit-tree-elbow-end-plus" : "bbit-tree-elbow-plus");
                        }
                    }
                    else {
                        cs.push(isend ? "bbit-tree-elbow-end" : "bbit-tree-elbow");
                    }
                    ht.push("<img class='bbit-tree-ec-icon ", cs.join(" "), "' src='" + dfop.cbiconpath + "s.gif'/>");
                    if (dfop.showcheck && nd.showcheck) {
                        if (nd.checkstate == null || nd.checkstate == undefined) {
                            nd.checkstate = 0;
                        }
                        ht.push("<img  id='", id, "_", nid, "_cb' class='bbit-tree-node-cb' src='", dfop.cbiconpath, dfop.icons[nd.checkstate], "'/>");
                    }

                    if (nd.hasChildren) {
                        if (nd.img == -1) {
                            ht.push("");
                        } else
                            if (!!nd.img) {
                                ht.push("<i class=\"" + nd.img + "\"></i>");
                            } else {
                                ht.push("<i class=\"fa fa-folder-open\" style='width:15px'></i>");
                            }
                    } else {
                        if (nd.img == -1) {
                            ht.push("");
                        } else
                            if (!!nd.img) {
                                ht.push("<i class=\"" + nd.img + "\"></i>");
                            } else {
                                ht.push("<i class=\"fa fa-file-text-o\"></i>");
                            }
                    }
                    ht.push("<a hideFocus class='bbit-tree-node-anchor' tabIndex=1 href='javascript:void(0);'>");
                    ht.push("<span data-value='" + nd.id + "' class='bbit-tree-node-text' unselectable='on'>", nd.text, "</span>");
                    ht.push("</a>");

                    if (dfop.isTool) {
                        ht.push("<div class='bbit-tree-node-tool'>");
                        for (var ii in dfop.nodeTools) {
                            var toolItem = dfop.nodeTools[ii];
                            ht.push("<span class='" + toolItem.img + "' title='" + toolItem.text + "'></span>");
                        }
                        ht.push("</div>");
                    }



                    ht.push("</div>");
                    if (nd.hasChildren) {
                        if (nd.isexpand) {
                            ht.push("<ul  class='bbit-tree-node-ct'  style='z-index: 0; position: static; visibility: visible; top: auto; left: auto;'>");
                            if (nd.ChildNodes) {
                                var l = nd.ChildNodes.length;
                                for (var k = 0; k < l; k++) {
                                    nd.ChildNodes[k].parent = nd;
                                    buildnode(nd.ChildNodes[k], ht, deep + 1, path + "." + k, k == l - 1);
                                }
                            }
                            ht.push("</ul>");
                        }
                        else {
                            ht.push("<ul style='display:none;'>");
                            if (nd.ChildNodes) {
                                var l = nd.ChildNodes.length;
                                for (var k = 0; k < l; k++) {
                                    nd.ChildNodes[k].parent = nd;
                                    buildnode(nd.ChildNodes[k], ht, deep + 1, path + "." + k, k == l - 1);
                                }
                            }
                            ht.push("</ul>");
                        }
                    }
                    ht.push("</li>");
                    nd.render = true;
                }
                function getItem(path) {
                    var ap = path.split(".");
                    var t = treenodes;
                    for (var i = 0; i < ap.length; i++) {
                        if (i == 0) {
                            t = t[ap[i]];
                        }
                        else {
                            t = t.ChildNodes[ap[i]];
                        }
                    }
                    return t;
                }
                function check(item, state, type) {
                    var pstate = item.checkstate;
                    if (type == 1) {
                        item.checkstate = state;
                    }
                    else {
                        var cs = item.ChildNodes;
                        var l = cs.length;
                        var ch = true;
                        for (var i = 0; i < l; i++) {
                            if ((state == 1 && cs[i].checkstate != 1) || state == 0 && cs[i].checkstate != 0) {
                                ch = false;
                                break;
                            }
                        }
                        if (ch) {
                            item.checkstate = state;
                        }
                        else {
                            item.checkstate = 2;
                        }
                    }
                    if (item.render && pstate != item.checkstate) {
                        var nid = item.id.replace(/[^\w]/gi, "_");
                        var et = $("#" + id + "_" + nid + "_cb");
                        if (et.length == 1) {
                            et.attr("src", dfop.cbiconpath + dfop.icons[item.checkstate]);
                        }
                    }
                }
                function cascade(fn, item, args) {
                    if (fn(item, args, 1) != false) {
                        if (item.ChildNodes != null && item.ChildNodes.length > 0) {
                            var cs = item.ChildNodes;
                            for (var i = 0, len = cs.length; i < len; i++) {
                                cascade(fn, cs[i], args);
                            }
                        }
                    }
                }
                function bubble(fn, item, args) {
                    var p = item.parent;
                    while (p) {
                        if (fn(p, args, 0) === false) {
                            break;
                        }
                        p = p.parent;
                    }
                }
                function nodeclick(e) {
                    var path = $(this).attr("tpath");
                    var et = e.target || e.srcElement;
                    var item = getItem(path);
                    if (et.tagName == "IMG") {
                        if ($(et).hasClass("bbit-tree-elbow-plus") || $(et).hasClass("bbit-tree-elbow-end-plus")) {
                            if ($(this).find('i').hasClass('fa-folder')) {
                                $(this).find('i').swapClass('fa-folder', 'fa-folder-open');
                            }
                            var ul = $(this).next();
                            if (ul.hasClass("bbit-tree-node-ct")) {
                                ul.slideDown(200);
                            }
                            else {
                                var deep = path.split(".").length;
                                if (item.complete) {
                                    alert(item.ChildNodes.length);
                                    item.ChildNodes != null && asnybuild(item.ChildNodes, deep, path, ul, item);
                                }
                                else {
                                    $(this).addClass("bbit-tree-node-loading");
                                    asnyloadc(item, true, function (data) {
                                        item.complete = true;
                                        item.ChildNodes = data;
                                        asnybuild(data, deep, path, ul, item);
                                    });
                                }
                            }
                            if ($(et).hasClass("bbit-tree-elbow-plus")) {
                                $(et).swapClass("bbit-tree-elbow-plus", "bbit-tree-elbow-minus");
                            }
                            else {
                                $(et).swapClass("bbit-tree-elbow-end-plus", "bbit-tree-elbow-end-minus");
                            }
                            $(this).swapClass("bbit-tree-node-collapsed", "bbit-tree-node-expanded");
                        }
                        else if ($(et).hasClass("bbit-tree-elbow-minus") || $(et).hasClass("bbit-tree-elbow-end-minus")) {
                            if ($(this).find('i').hasClass('fa-folder-open')) {
                                $(this).find('i').swapClass('fa-folder-open', 'fa-folder');
                            }
                            $(this).next().slideUp(200);
                            if ($(et).hasClass("bbit-tree-elbow-minus")) {
                                $(et).swapClass("bbit-tree-elbow-minus", "bbit-tree-elbow-plus");
                            }
                            else {
                                $(et).swapClass("bbit-tree-elbow-end-minus", "bbit-tree-elbow-end-plus");
                            }
                            $(this).swapClass("bbit-tree-node-expanded", "bbit-tree-node-collapsed");
                        }
                        else if ($(et).hasClass("bbit-tree-node-cb")) {
                            var s = item.checkstate != 1 ? 1 : 0;
                            var r = true;
                            if (dfop.oncheckboxclick) {
                                r = dfop.oncheckboxclick.call(et, item, s);
                            }
                            if (r != false) {
                                if (dfop.cascadecheck) {
                                    cascade(check, item, s);
                                    bubble(check, item, s);
                                }
                                else {
                                    check(item, s, 1);
                                }
                            }
                        }
                    }
                    else {
                        if (dfop.citem) {
                            var nid = dfop.citem.id.replace(/[^\w]/gi, "_");
                            $("." + id).removeClass("bbit-tree-selected");
                        }
                        dfop.citem = item;
                        $("." + id).find('div').removeClass("bbit-tree-selected");
                        $(this).addClass("bbit-tree-selected");
                        if (dfop.onnodeclick) {
                            if (!item.expand) {
                                item.expand = function () { expandnode.call(item); };
                            }
                            dfop.onnodeclick.call(this, item);
                        }
                    }
                }
                function expandnode() {
                    var item = this;
                    var nid = item.id.replace(/[^\w]/gi, "_");
                    var img = $("#" + id + "_" + nid + " img.bbit-tree-ec-icon");
                    if (img.length > 0) {
                        img.click();
                    }
                }
                function asnybuild(nodes, deep, path, ul, pnode) {
                    var l = nodes.length;
                    if (l > 0) {
                        var ht = [];
                        for (var i = 0; i < l; i++) {
                            nodes[i].parent = pnode;
                            buildnode(nodes[i], ht, deep, path + "." + i, i == l - 1);
                        }
                        ul.html(ht.join(""));
                        ht = null;
                        InitEvent(ul);
                    }
                    ul.addClass("bbit-tree-node-ct").css({ "z-index": 0, position: "static", visibility: "visible", top: "auto", left: "auto", display: "" });
                    ul.prev().removeClass("bbit-tree-node-loading");
                }
                function asnyloadc(pnode, isAsync, callback) {
                    if (dfop.url) {
                        if (dfop.param != null) {
                            var param = dfop.param
                        }
                        if (pnode && pnode != null) {
                            var param = builparam(pnode);
                        }
                        $.ajax({
                            type: dfop.method,
                            url: dfop.url,
                            data: param,
                            async: isAsync,
                            dataType: dfop.datatype,
                            success: callback,
                            error: function (e) { dialogMsg("服务端未响应。", -1); }
                        });
                    }
                }
                function builparam(node) {
                    var p = {
                        id: encodeURIComponent(node.id)
                            , text: encodeURIComponent(node.text)
                            , value: encodeURIComponent(node.value)
                            , checkstate: typeof (node.checkstate) == "undefined" ? '' : node.checkstate
                    };
                    return p;
                }
                function bindevent() {
                    $(this).hover(function () {
                        $(this).addClass("bbit-tree-node-over");
                    }, function () {
                        $(this).removeClass("bbit-tree-node-over");
                    }).click(nodeclick)
                     .find("img.bbit-tree-ec-icon").each(function (e) {
                         if (!$(this).hasClass("bbit-tree-elbow")) {
                             $(this).hover(function () {
                                 $(this).parent().addClass("bbit-tree-ec-over");
                             }, function () {
                                 $(this).parent().removeClass("bbit-tree-ec-over");
                             });
                         }
                     });
                }
                function InitEvent(parent) {
                    var nodes = $("li.bbit-tree-node>div", parent);
                    nodes.each(bindevent);
                }
                function reflash(itemId) {
                    var nid = itemId.replace(/[^\w-]/gi, "_");
                    var node = $("#" + id + "_" + nid);
                    if (node.length > 0) {
                        node.addClass("bbit-tree-node-loading");
                        var isend = node.hasClass("bbit-tree-elbow-end") || node.hasClass("bbit-tree-elbow-end-plus") || node.hasClass("bbit-tree-elbow-end-minus");
                        var path = node.attr("tpath");
                        var deep = path.split(".").length;
                        var item = getItem(path);
                        if (item) {
                            asnyloadc(item, true, function (data) {

                                item.complete = true;
                                item.ChildNodes = data;
                                item.isexpand = true;
                                if (data && data.length > 0) {
                                    item.hasChildren = true;
                                }
                                else {
                                    item.hasChildren = false;
                                }
                                var ht = [];
                                buildnode(item, ht, deep - 1, path, isend);
                                ht.shift();
                                ht.pop();
                                var li = node.parent();
                                li.html(ht.join(""));
                                ht = null;
                                InitEvent(li);
                                bindevent.call(li.find(">div"));
                            });
                        }
                    }
                }
                function getck(items, c, fn) {
                    for (var i = 0, l = items.length; i < l; i++) {
                        (items[i].showcheck == true && items[i].checkstate == 1) && c.push(fn(items[i]));
                        if (items[i].ChildNodes != null && items[i].ChildNodes.length > 0) {
                            getck(items[i].ChildNodes, c, fn);
                        }
                    }
                }
                function getCkAndHalfCk(items, c, fn) {
                    for (var i = 0, l = items.length; i < l; i++) {
                        (items[i].showcheck == true && (items[i].checkstate == 1 || items[i].checkstate == 2)) && c.push(fn(items[i]));
                        if (items[i].ChildNodes != null && items[i].ChildNodes.length > 0) {
                            getCkAndHalfCk(items[i].ChildNodes, c, fn);
                        }
                    }
                }
                me[0].t = {
                    getSelectedNodes: function (gethalfchecknode) {
                        var s = [];
                        if (gethalfchecknode) {
                            getCkAndHalfCk(treenodes, s, function (item) { return item; });
                        }
                        else {
                            getck(treenodes, s, function (item) { return item; });
                        }
                        return s;
                    },
                    getSelectedValues: function () {
                        var s = [];
                        getck(treenodes, s, function (item) { return item.value; });
                        return s;
                    },
                    getCurrentItem: function () {
                        return dfop.citem;
                    },
                    reflash: function (itemOrItemId) {
                        var id;
                        if (typeof (itemOrItemId) == "string") {
                            id = itemOrItemId;
                        }
                        else {
                            id = itemOrItemId.id;
                        }
                        reflash(id);
                    }
                };
                return me;
            };
            $.fn.getCheckedNodes = function () {
                var $id = $(this);
                var _length = $id.attr('id').trim().length + 1;
                var value = []
                $id.find('.bbit-tree-node-cb').each(function () {
                    var _src = $(this).attr('src');
                    _src = _src.substr(_src.lastIndexOf("/") + 1);
                    if (_src == 'checkbox_1.png' || _src == 'checkbox_2.png') {
                        var _value = $(this).attr('id').substring(parseInt(_length)).replace(/_/g, "-");
                        _value = _value.substring(0, _value.length - 3);
                        value.push(_value)
                    }
                });
                return value;
            };
            $.fn.setCheckedNodes = function (data) {
                var $id = $(this);
                var id = $id.attr('id').trim();
                $.each(data, function (i, item) {
                    var object = $id.find(('#' + id + '_' + item.replace(/-/g, "_") + '_cb'));
                    if (object.length != 0) {
                        object.trigger("click");
                    }
                });
            }
            $.fn.setCheckedNodeOne = function (data) {
                var $id = $(this);
                var id = $id.attr('id').trim();
                var object = $id.find(('#' + id + '_' + data.replace(/-/g, "_") + '_cb'));
                if (object.length != 0) {
                    object.trigger("click");
                }

            }
            $.fn.setNoCheckedNodes = function (item) {
                var $id = $(this);
                var id = $id.attr('id').trim();
                var object = $id.find(('#' + id + '_' + item.replace(/-/g, "_") + '_cb'));
                var _src = object.attr('src');
                object.attr('src', _src.replace('checkbox_1.png', 'checkbox_0.png'));
            }

            $.fn.getTSNs = function (gethalfchecknode) {
                if (this[0].t) {
                    return this[0].t.getSelectedNodes(gethalfchecknode);
                }
                return null;
            };
            $.fn.getCurrentNode = function () {
                if (this[0].t) {
                    return this[0].t.getCurrentItem();
                }
                return null;
            };
            $.fn.reflash = function (ItemOrItemId) {
                if (this[0].t) {
                    return this[0].t.reflash(ItemOrItemId);
                }
            };
            $.fn.setTreeHeight = function (height) {
                var me = $(this);
                me.height(height);
            }
            $.fn.setNodeChecked = function (value) {
                var $id = $(this);
                var id = $id.attr('id').trim();
                $id.find('.bbit-tree-selected').removeClass('bbit-tree-selected');
                var object = $id.find(('#' + id + '_' + value.replace(/-/g, "_")));
                object.addClass('bbit-tree-selected');
            }
        })(jQuery);
    </script>
    <script type="text/javascript">
        var index;
        $.detailOpen = function (options) {
            var defaults = {
                id: null,
                title: '输入窗口',
                url: '',
                shade: 0.3
            };
            var options = $.extend(defaults, options);
            var _width = $(window).width() + 'px';
            var _height = $(window).height() + 'px';
            index = layer.open({
                id: options.id,
                type: 2,
                closeBtn: 0,
                shade: options.shade,
                title: options.title,
                fix: false,
                area: [_width, _height],
                offset: [0, 1],
                content: options.url
            });
        }
        $.detailClose = function () {
            layer.close(index);
        }
        $.detailOpen2 = function (options) {
            var defaults = {
                id: null,
                title: '输入窗口',
                url: '',
                shade: 0.6
            };
            var options = $.extend(defaults, options);
            //var _width = $(window).width() + 'px';
            //var _height = $(window).height() + 'px';
            var _width = '800px';
            var _height = '480px';
            index = layer.open({
                id: options.id,
                type: 2,
                closeBtn: 2,
                shade: options.shade,
                title: options.title,
                //fix: false,
                area: [_width, _height],
                //offset: [0, 1],
                content: options.url
            });
        }
        $.detailOpen3 = function (options) {
            var defaults = {
                id: null,
                title: '输入窗口',
                url: '',
                shade: 0.6,
                width: 540,
                height: 360
            };
            var options = $.extend(defaults, options);
            var _width = options.width + 'px';
            var _height = options.height + 'px';
            index = layer.open({
                id: options.id,
                type: 2,
                closeBtn: 2,
                shade: options.shade,
                title: options.title,
                area: [_width, _height],
                content: options.url
            });
        }

        var topIndex;
        $.detailOpenTop = function (options) {
            var defaults = {
                id: null,
                title: '输入窗口',
                url: '',
                shade: 0.6,
                width: 540,
                height: 360
            };
            var options = $.extend(defaults, options);
            var _width = options.width + 'px';
            var _height = options.height + 'px';
            index = top.layer.open({
                id: options.id,
                type: 2,
                closeBtn: 2,
                shade: options.shade,
                title: options.title,
                area: [_width, _height],
                content: options.url
            });
        }
        $.detailCloseTop = function () {
            top.layer.close(index);
        }
        function show_selector() {
            selector_window = layer.open({
                type: 1,
                title: '',
                offset: '110px',
                skin: 'layui-layer-rim',
                area: ['400px', '132px'], //宽高
                closeBtn: 0, //不显示关闭按钮
                content: '<div class="" style="background-color: rgb(26, 188, 156);height: 32px;line-height: 32px;font-size: 14px;font-weight: 900;color: #fff;padding-left: 15px;">请选择操作：</div>\
            <div style="text-align:center;padding: 28px 0 15px 12px;">\
            <div class="btn-group" style="">\
                <a id="" class="btn btn-primary center-block" onclick="" href="/BOM/Product/SingleQuery"><span class="glyphicon glyphicon-th-list"></span> 目录</a>\
            </div>\
            <div class="btn-group" style="margin-left:10px;">\
                <a id="" class="btn btn-primary center-block" onclick="btn_next()"><span class="glyphicon glyphicon-plus"></span> 展开</a>\
            </div>\
            <div class="btn-group" style="margin-left:10px;">\
                <a id="" class="btn btn-primary center-block" onclick="btn_previous()"><span class="glyphicon glyphicon-minus"></span> 回归</a>\
            </div>\
            <div class="btn-group" style="margin-left:10px;">\
                <a id="btn_cancel" class="btn btn-danger center-block" onclick="btn_cancel_selector()"><span class="glyphicon glyphicon-remove"></span> 取消</a>\
            </div>\
       </div>'
            });
        }
        function btn_cancel_selector() {
            layer.close(selector_window);
        }
        $(function () {
            $("input[type=text].number").on("keyup", function () {
                onlyNumber(this);
            });
            $("input[type=text].digits").on("keyup", function () {
                onlyDigital(this);
            });
            $("input[type=text].isInteger").on("keyup", function () {
                onlyInteger(this);
            });
            $("input[type=text].isNumber").on("keyup", function () {
                onlyIsNumber(this);
            });
            //$("input[type=text].number").on("input", function () {
            //    onlyNumber(this);
            //});
            //$("input[type=text].number").on("input", function () {
            //    onlyNumber(this);
            //});
            //$("input[type=text].digits").on("propertychange", function () {
            //    onlyDigital(this);
            //});
            //$("input[type=text].digits").on("propertychange", function () {
            //    onlyDigital(this);
            //});
            //$("input[type=text].number").on("focus", function () {
            //    var result = $(this).val();//对input取值
            //    alert(result);
            //    $(this).val("")//使input的值为空
            //    $(this).val(result)
            //});
            document.onkeydown = function (e) {
                var keyEvent;
                if (e.keyCode == 8) {
                    var d = e.srcElement || e.target;
                    if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') {
                        keyEvent = d.readOnly || d.disabled;
                    } else {
                        keyEvent = true;
                    }
                } else {
                    keyEvent = false;
                }
                if (keyEvent) {
                    e.preventDefault();
                }
            }
        })
    </script>
</head>
<body>
    @RenderBody()
    @Html.AntiForgeryToken()
</body>
</html>
